#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "threadcheckcardstate.h"
#include "threadtoapp.h"
#include "threadnfcreader.h"
#include "mlsMarlin.h"
#include "button.h"
#include "textstring.h"
#include "swipegesturerecognizer.h"
#include "sleeper.h"
#include "threadcountup.h"
#include <QPushButton>
#include <QMainWindow>
#include <QtCore/QVariant>
#include <QAction>
#include <QApplication>
#include <QButtonGroup>
#include <QGraphicsView>
#include <QHeaderView>
#include <QLabel>
#include <QWidget>
#include <QFontMetrics>
#include <QMainWindow>
#include <QStatusBar>
#include <QTimer>
#include <QDebug>
#include <QColor>
#include <QColorDialog>
#include <QStackedWidget>
#include <QVBoxLayout>
#include <QGestureEvent>
#include <QWSServer>
#include <QShowEvent>
#include <QThread>
#include <QPointer>
#include <QPropertyAnimation>
#include <QParallelAnimationGroup>
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void initializeDataButton(button *);
    void drawButton(button *);
    void initializeDataTextString(TextString*);
    void drawTextString(TextString *);
    void drawRunTime();
    void drawFirstScreen(QWidget *);
    void drawSecondScreen(QWidget *);
    void clearScreen(QWidget *);
    void drawCardState(QWidget *, QString);
    void testIntergrated();


protected:
    bool event(QEvent *event);
    void paintEvent(QPaintEvent *event);
    void mouseDoubleClickEvent(QMouseEvent *event);
    void showEvent(QShowEvent *event );

private:
    bool gestureEvent(QGestureEvent *event);
    void swipeTriggered(QSwipeGesture*);
    SwipeGestureRecognizer* pRecognizer;
    int screenIndex ;
    int maxIndexScreen;
    QGraphicsView **graphicsView;


private slots:
    void on_pushButton_clicked();
    void drawFollowApp();
    void on_MainWindow_iconSizeChanged(const QSize &iconSize);
    void displayChangeTimeIndex(int );
    void slotHandleCardAbsent();
    void slotHandleCardPresent();

signals:
    void appLetDraw();

private:
    Ui::MainWindow *ui;
    QStackedWidget *listScreen;
    QLabel *listLable;
    button *b,*c;
    TextString *text;
};

#endif // MAINWINDOW_H
